<template>
  <el-row type="flex" style="background: #34373c; margin: 0">
    <el-col :span="6">
      <div class="grid-content bg-purple">
        <el-popover
          placement="bottom-start"
          title="轿车"
          width="200"
          trigger="hover"
          content="这是轿车文案"
        >
          <div slot="reference" class="popo" @click="toSearch('轿车')">
            轿车
          </div>
        </el-popover>
      </div>
    </el-col>
    <el-col :span="6">
      <div class="grid-content bg-purple-light">
        <el-popover
          placement="bottom"
          title="SUV"
          width="200"
          trigger="hover"
          content="这是SUV文案"
        >
          <div slot="reference" class="popo" @click="toSearch('SUV')">SUV</div>
        </el-popover>
      </div>
    </el-col>
    <el-col :span="12">
      <div class="grid-content bg-purple">
        <el-popover
          placement="bottom"
          title="论坛入口"
          width="400"
          trigger="hover"
          content="这是论坛入口文案"
        >
          <div slot="reference" class="popo" @click="toForum()">论坛入口</div>
        </el-popover>
      </div>
    </el-col>
    <el-col :span="6">
      <div class="grid-content bg-purple-light">
        <el-popover
          placement="bottom"
          title="跑车"
          width="200"
          trigger="hover"
          content="这是跑车文案"
        >
          <div slot="reference" class="popo" @click="toSearch('跑车')">
            跑车
          </div>
        </el-popover>
      </div>
    </el-col>
    <el-col :span="6">
      <div class="grid-content bg-purple">
        <el-popover
          placement="bottom"
          title="微面"
          width="200"
          trigger="hover"
          content="这是微面文案"
        >
          <div slot="reference" class="popo" @click="toSearch('微面')">
            微面
          </div>
        </el-popover>
      </div>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: "FastBar",
  methods: {
    toSearch(carName) {
      this.$router.push(`/search/${carName}`);
    },
    toForum() {
      this.$router.push("/forum");
    },
  },
};
</script>

<style scoped>
.el-row {
  height: 50px;
  margin-bottom: 4px;
}

.el-col {
  border-radius: 4px;
}

.bg-purple {
  background: #34373c;
  height: 50px;
}

.bg-purple-light {
  background: #34373c;
  height: 50px;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}

.popo {
  font-size: 20px;
  line-height: 50px;
  letter-spacing: 5px;
  cursor: pointer;
  color: #f9fafc;
}

</style>
